package cn.zjjd.wlproject.hhx.demo.controller;

import cn.zjjd.wlproject.hhx.demo.pojo.Mappoint;
import cn.zjjd.wlproject.hhx.demo.service.MapService;
import cn.zjjd.wlproject.hhx.demo.util.GeneralResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class MapController {
    @Autowired
    private MapService mapService;

    @GetMapping("/queryStudentPosition")
    public GeneralResponse queryStudentPosition(@RequestParam int number){
        GeneralResponse response = new GeneralResponse();
        response.setSuccess(true);
        List<Mappoint> result = new ArrayList<>();
        result.add(mapService.queryStudentPosition(number));
        response.setData(result);
        return  response;
    }
    @GetMapping("/queryStudent48Trace")
    public GeneralResponse queryStudent48Trace(@RequestParam int number){
        GeneralResponse response = new GeneralResponse();
        response.setSuccess(true);
        response.setData(mapService.queryStudent48Trace(number));
        return  response;
    }
}
